package o;

import android.content.Context;
import o.dex.a;
import o.dex.d;

public class bfl implements Runnable {
    private Context ˋ;
    private bfm ˏ;

    public bfl(bfm o_bfm, Context context) {
        this.ˋ = context;
        this.ˏ = o_bfm;
    }

    public void run() {
        if (this.ˋ != null && this.ˏ != null) {
            if (this.ˏ.ˏ()) {
                ˎ(bgd.ॱ().ˊ(this.ˋ));
                bgd.ॱ().ˏ(this.ˋ);
                return;
            }
            ˎ(d.ˎ);
        }
    }

    private void ˎ(d dVar) {
        if (fam.ॱ().ʻ()) {
            fam.ॱ().ॱ(this.ˋ, ˋ(dVar));
        } else if (fam.ॱ().ॱ(ˎ())) {
            fam.ॱ().ॱ(this.ˋ, false);
            fam.ॱ().ॱ(this.ˋ, ˋ(dVar));
        } else {
            fam.ॱ().ˋ(this.ˋ);
        }
    }

    private dex ˋ(d dVar) {
        dex o_bhm = new bhm(this.ˋ);
        o_bhm.ˎ(dVar);
        if (dVar == d.ˋ) {
            beq.ˋ("DOCK", "NONE");
        } else {
            beq.ˋ("CONTENT", "NONE");
        }
        return o_bhm;
    }

    private a ˎ() {
        a aVar = a.ˏ;
        if (this.ˏ != null) {
            return this.ˏ.ˊ();
        }
        return aVar;
    }
}
